home *** CD-ROM | disk | FTP | other *** search
/ Best Tools for JAVA / Best Tools for JAVA.iso / VIEWERS / VSVIEW / VSVIEW.ZIP / FOPTIONS.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-10-07  |  23.4 KB  |  702 lines

  1. VERSION 2.00
  2. Begin Form foptions 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Replacement for the Printer Object"
  6.    ClientHeight    =   5100
  7.    ClientLeft      =   630
  8.    ClientTop       =   1470
  9.    ClientWidth     =   7200
  10.    ControlBox      =   0   'False
  11.    Height          =   5565
  12.    Left            =   570
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   5100
  17.    ScaleWidth      =   7200
  18.    Top             =   1065
  19.    Width           =   7320
  20.    Begin CommandButton Command2 
  21.       Caption         =   "Command2"
  22.       Height          =   315
  23.       Left            =   60
  24.       TabIndex        =   13
  25.       Top             =   60
  26.       Width           =   315
  27.    End
  28.    Begin CheckBox Check2 
  29.       BackColor       =   &H00C0C0C0&
  30.       Caption         =   "Landscape"
  31.       FontBold        =   0   'False
  32.       FontItalic      =   0   'False
  33.       FontName        =   "MS Sans Serif"
  34.       FontSize        =   8.25
  35.       FontStrikethru  =   0   'False
  36.       FontUnderline   =   0   'False
  37.       Height          =   195
  38.       Left            =   240
  39.       TabIndex        =   12
  40.       Top             =   1680
  41.       Width           =   1155
  42.    End
  43.    Begin CommandButton Command1 
  44.       BackColor       =   &H00C0C0C0&
  45.       Caption         =   "Hello"
  46.       FontBold        =   0   'False
  47.       FontItalic      =   0   'False
  48.       FontName        =   "MS Sans Serif"
  49.       FontSize        =   8.25
  50.       FontStrikethru  =   0   'False
  51.       FontUnderline   =   0   'False
  52.       Height          =   300
  53.       Index           =   5
  54.       Left            =   190
  55.       TabIndex        =   11
  56.       Top             =   3800
  57.       Width           =   1300
  58.    End
  59.    Begin ComboBox cmbDev 
  60.       FontBold        =   0   'False
  61.       FontItalic      =   0   'False
  62.       FontName        =   "MS Sans Serif"
  63.       FontSize        =   8.25
  64.       FontStrikethru  =   0   'False
  65.       FontUnderline   =   0   'False
  66.       Height          =   300
  67.       Left            =   240
  68.       Style           =   2  'Dropdown List
  69.       TabIndex        =   8
  70.       Top             =   1260
  71.       Width           =   1300
  72.    End
  73.    Begin CheckBox Check1 
  74.       BackColor       =   &H00C0C0C0&
  75.       Caption         =   "Preview"
  76.       FontBold        =   0   'False
  77.       FontItalic      =   0   'False
  78.       FontName        =   "MS Sans Serif"
  79.       FontSize        =   8.25
  80.       FontStrikethru  =   0   'False
  81.       FontUnderline   =   0   'False
  82.       Height          =   195
  83.       Left            =   240
  84.       TabIndex        =   7
  85.       Top             =   780
  86.       Value           =   1  'Checked
  87.       Width           =   1035
  88.    End
  89.    Begin vsInForm vsInForm1 
  90.       BarHeight       =   23
  91.       Caption         =   "vsPrinter: A Smart Replacement for the Printer Object"
  92.       ConvInfo        =   FOPTIONS.FRX:0000
  93.       CustomFrame     =   -1  'True
  94.       FontBold        =   0   'False
  95.       FontItalic      =   0   'False
  96.       FontName        =   "Arial"
  97.       FontSize        =   9
  98.       FontStrikethru  =   0   'False
  99.       FontUnderline   =   0   'False
  100.       FrameCorners    =   0   'False
  101.       FrameSizing     =   0  'None
  102.       FrameStyle      =   4  'Raised Frame
  103.       Left            =   60
  104.       PictLeft0       =   FOPTIONS.FRX:000B
  105.       Top             =   -1800
  106.    End
  107.    Begin vsViewPort vsViewPort1 
  108.       BackColor       =   &H00C0C0FF&
  109.       ConvInfo        =   FOPTIONS.FRX:00DD
  110.       Height          =   4890
  111.       LargeChangeHorz =   900
  112.       LargeChangeVert =   900
  113.       Left            =   1695
  114.       SmallChangeHorz =   300
  115.       SmallChangeVert =   300
  116.       Top             =   105
  117.       VirtualHeight   =   0
  118.       VirtualWidth    =   0
  119.       Width           =   5355
  120.       Begin vsPrinter VSPrinter1 
  121.          AbortCaption    =   "This is the abort caption"
  122.          BackColor       =   &H00FFFFFF&
  123.          BrushStyle      =   1  'Transparent
  124.          ConvInfo        =   FOPTIONS.FRX:00E8
  125.          FontName        =   "Times New Roman"
  126.          FontSize        =   14
  127.          Footer          =   "||Page %d"
  128.          HdrFontBold     =   -1  'True
  129.          HdrFontName     =   "Arial"
  130.          HdrFontSize     =   18
  131.          Header          =   "VSPrinter||VideoSoft's Visual Printer"
  132.          Height          =   3585
  133.          Left            =   200
  134.          MarginBottom    =   1440
  135.          MarginLeft      =   1440
  136.          MarginTop       =   1440
  137.          PenWidth        =   3
  138.          PhysicalPage    =   -1  'True
  139.          PreviewMode     =   2  'Force Monochrome
  140.          TableBorder     =   9  'Box Columns
  141.          Top             =   200
  142.          Width           =   2850
  143.       End
  144.       Begin Image Image2 
  145.          Height          =   795
  146.          Index           =   2
  147.          Left            =   3600
  148.          Picture         =   FOPTIONS.FRX:00F3
  149.          Stretch         =   -1  'True
  150.          Top             =   1320
  151.          Visible         =   0   'False
  152.          Width           =   795
  153.       End
  154.       Begin Image Image2 
  155.          Height          =   795
  156.          Index           =   1
  157.          Left            =   3600
  158.          Picture         =   FOPTIONS.FRX:03F5
  159.          Stretch         =   -1  'True
  160.          Top             =   2280
  161.          Visible         =   0   'False
  162.          Width           =   795
  163.       End
  164.       Begin Image Image2 
  165.          Height          =   795
  166.          Index           =   0
  167.          Left            =   3540
  168.          Picture         =   FOPTIONS.FRX:0BB9
  169.          Stretch         =   -1  'True
  170.          Top             =   300
  171.          Visible         =   0   'False
  172.          Width           =   795
  173.       End
  174.    End
  175.    Begin ComboBox cmbZoom 
  176.       FontBold        =   0   'False
  177.       FontItalic      =   0   'False
  178.       FontName        =   "MS Sans Serif"
  179.       FontSize        =   8.25
  180.       FontStrikethru  =   0   'False
  181.       FontUnderline   =   0   'False
  182.       Height          =   300
  183.       Left            =   240
  184.       Style           =   2  'Dropdown List
  185.       TabIndex        =   6
  186.       Top             =   405
  187.       Width           =   1300
  188.    End
  189.    Begin CommandButton Command1 
  190.       BackColor       =   &H00C0C0C0&
  191.       Caption         =   "Graphics"
  192.       FontBold        =   0   'False
  193.       FontItalic      =   0   'False
  194.       FontName        =   "MS Sans Serif"
  195.       FontSize        =   8.25
  196.       FontStrikethru  =   0   'False
  197.       FontUnderline   =   0   'False
  198.       Height          =   300
  199.       Index           =   4
  200.       Left            =   190
  201.       TabIndex        =   5
  202.       Top             =   3500
  203.       Width           =   1300
  204.    End
  205.    Begin CommandButton Command1 
  206.       BackColor       =   &H00C0C0C0&
  207.       Caption         =   "Multi-Column"
  208.       FontBold        =   0   'False
  209.       FontItalic      =   0   'False
  210.       FontName        =   "MS Sans Serif"
  211.       FontSize        =   8.25
  212.       FontStrikethru  =   0   'False
  213.       FontUnderline   =   0   'False
  214.       Height          =   300
  215.       Index           =   3
  216.       Left            =   190
  217.       TabIndex        =   3
  218.       Top             =   2900
  219.       Width           =   1300
  220.    End
  221.    Begin CommandButton Command1 
  222.       BackColor       =   &H00C0C0C0&
  223.       Caption         =   "Tables"
  224.       FontBold        =   0   'False
  225.       FontItalic      =   0   'False
  226.       FontName        =   "MS Sans Serif"
  227.       FontSize        =   8.25
  228.       FontStrikethru  =   0   'False
  229.       FontUnderline   =   0   'False
  230.       Height          =   300
  231.       Index           =   2
  232.       Left            =   190
  233.       TabIndex        =   2
  234.       Top             =   3200
  235.       Width           =   1300
  236.    End
  237.    Begin CommandButton Command1 
  238.       BackColor       =   &H00C0C0C0&
  239.       Caption         =   "Paragraph"
  240.       FontBold        =   0   'False
  241.       FontItalic      =   0   'False
  242.       FontName        =   "MS Sans Serif"
  243.       FontSize        =   8.25
  244.       FontStrikethru  =   0   'False
  245.       FontUnderline   =   0   'False
  246.       Height          =   300
  247.       Index           =   1
  248.       Left            =   190
  249.       TabIndex        =   1
  250.       Top             =   2600
  251.       Width           =   1300
  252.    End
  253.    Begin CommandButton Command1 
  254.       BackColor       =   &H00C0C0C0&
  255.       Caption         =   "Line by Line"
  256.       FontBold        =   0   'False
  257.       FontItalic      =   0   'False
  258.       FontName        =   "MS Sans Serif"
  259.       FontSize        =   8.25
  260.       FontStrikethru  =   0   'False
  261.       FontUnderline   =   0   'False
  262.       Height          =   300
  263.       Index           =   0
  264.       Left            =   190
  265.       TabIndex        =   0
  266.       Top             =   2300
  267.       Width           =   1300
  268.    End
  269.    Begin Image Image1 
  270.       BorderStyle     =   1  'Fixed Single
  271.       Height          =   1035
  272.       Left            =   240
  273.       Stretch         =   -1  'True
  274.       Top             =   4140
  275.       Width           =   795
  276.    End
  277.    Begin Label Label1 
  278.       Alignment       =   2  'Center
  279.       AutoSize        =   -1  'True
  280.       BackStyle       =   0  'Transparent
  281.       Caption         =   "Options"
  282.       ForeColor       =   &H00000000&
  283.       Height          =   195
  284.       Index           =   2
  285.       Left            =   195
  286.       TabIndex        =   10
  287.       Top             =   2040
  288.       Width           =   675
  289.    End
  290.    Begin Label Label1 
  291.       Alignment       =   2  'Center
  292.       AutoSize        =   -1  'True
  293.       BackStyle       =   0  'Transparent
  294.       Caption         =   "Device"
  295.       ForeColor       =   &H00000000&
  296.       Height          =   195
  297.       Index           =   0
  298.       Left            =   240
  299.       TabIndex        =   9
  300.       Top             =   1020
  301.       Width           =   645
  302.    End
  303.    Begin Label Label1 
  304.       Alignment       =   2  'Center
  305.       AutoSize        =   -1  'True
  306.       BackStyle       =   0  'Transparent
  307.       Caption         =   "Zoom"
  308.       ForeColor       =   &H00000000&
  309.       Height          =   195
  310.       Index           =   1
  311.       Left            =   240
  312.       TabIndex        =   4
  313.       Top             =   195
  314.       Width           =   495
  315.    End
  316. Option Explicit
  317. ' ------------------------------------
  318. ' ** VSView Printer Control Utility:
  319. ' ------------------------------------
  320. ' This routine prints a boxed paragraph at the specified
  321. ' position (x, y), with a specified width (wid). The text
  322. ' wraps as needed to fit the desired width.
  323. ' Define the appearance of the box using the Pen* and Brush*
  324. ' properties, and the font with the Font* properties.
  325. ' You can also use the TextAlign property to format the
  326. ' paragraph.
  327. ' Then call this routine to print boxed paragraphs.
  328. ' Note: This routine actually prints the text twice: once
  329. ' only to measure it, then to actually show it. This is
  330. ' not terribly efficient, but it's easy and works well.
  331. Sub BoxedPara (vsPrnt As Control, X&, Y&, wid&, s$)
  332.   Dim ml&, mr&, mb&, cl&
  333.   ' save current settings
  334.   ml = vsPrnt.MarginLeft
  335.   mr = vsPrnt.MarginRight
  336.   mb = vsPrnt.MarginBottom
  337.   cl = vsPrnt.TextColor
  338.   ' set temporary margins
  339.   vsPrnt.MarginLeft = X
  340.   vsPrnt.MarginRight = vsPrnt.PageWidth - X - wid
  341.   vsPrnt.MarginBottom = -10000
  342.   ' measure the text (inefficient but easy...)
  343.   vsPrnt.CurrentX = X
  344.   vsPrnt.CurrentY = Y
  345.   vsPrnt.TextColor = RGB(255, 255, 255)
  346.   vsPrnt = s
  347.   ' draw a box
  348.   vsPrnt.x1 = X
  349.   vsPrnt.y1 = Y
  350.   vsPrnt.x2 = X + wid
  351.   vsPrnt.y2 = vsPrnt.CurrentY
  352.   vsPrnt.Draw = 2
  353.   ' draw the text
  354.   vsPrnt.CurrentX = X
  355.   vsPrnt.CurrentY = Y
  356.   vsPrnt.TextColor = cl
  357.   vsPrnt = s
  358.   ' restore settings
  359.   vsPrnt.MarginLeft = ml
  360.   vsPrnt.MarginRight = mr
  361.   vsPrnt.MarginBottom = mb
  362. End Sub
  363. ' ------------------------------------
  364. ' ** VSView Printer Control Utility:
  365. ' ------------------------------------
  366. ' This routine prints single-line text inside a box at a
  367. ' specified position (x, y).
  368. ' Define the appearance of the box using the Pen* and Brush*
  369. ' properties, and the font with the Font* properties.
  370. ' Then call this routine to print single-line boxed text.
  371. Sub BoxedText (vsPrnt As Control, X&, Y&, s$)
  372.   Dim mr&
  373.   ' save right margin
  374.   mr = vsPrnt.MarginRight
  375.   ' draw box
  376.   vsPrnt.Measure = s
  377.   vsPrnt.x1 = X
  378.   vsPrnt.y1 = Y
  379.   vsPrnt.x2 = X + vsPrnt.TextWid
  380.   vsPrnt.y2 = Y + vsPrnt.TextHei
  381.   vsPrnt.Draw = 2 ' box
  382.   ' draw text, no breaks
  383.   vsPrnt.MarginRight = -1000
  384.   vsPrnt.CurrentX = X
  385.   vsPrnt.CurrentY = Y
  386.   vsPrnt.Text = s
  387.   ' restore margin
  388.   vsPrnt.MarginRight = mr
  389. End Sub
  390. Sub Check2_Click ()
  391.   ' adjust orientation to match
  392.   If check2.Value Then
  393.     vsprinter1.Orientation = 1
  394.   Else
  395.     vsprinter1.Orientation = 0
  396.   End If
  397.   ' reset page size
  398.   cmbZoom_Click
  399.   Command1_Click (Val(tag))
  400. End Sub
  401. Sub cmbDev_Click ()
  402.   If vsprinter1.Device = cmbDev Then Exit Sub
  403.   vsprinter1.Device = cmbDev
  404. End Sub
  405. Sub cmbZoom_Click ()
  406.   mousePointer = 11
  407.   vsprinter1.Width = vsprinter1.PageWidth * Val(cmbZoom) / 100
  408.   vsprinter1.Height = vsprinter1.PageHeight * Val(cmbZoom) / 100
  409.   vsViewPort1.VirtualWidth = vsprinter1.Width + 400
  410.   vsViewPort1.VirtualHeight = vsprinter1.Height + 400
  411.   mousePointer = 0
  412. End Sub
  413. Sub Command1_Click (index%)
  414.   Dim s$, nl$, i%, X%, Y%
  415.   Dim rc As RECT
  416.   tag = Str(index)
  417.   mousePointer = 11
  418.   On Error Resume Next
  419.   ' init printer control
  420.   vsprinter1.Preview = Check1
  421.   vsprinter1.Columns = 1
  422.   vsprinter1.PageBorder = 3
  423.   vsprinter1.TextAlign = 0
  424.   vsprinter1.FontName = "Times New Roman"
  425.   vsprinter1.FontSize = 12
  426.   vsprinter1.FontBold = False
  427.   vsprinter1.Header = "GDI resources: " & vsInform1.FreeGDI & "%% free"
  428.   vsprinter1.Action = 3
  429. '  DoEvents
  430.   SetDlgItemText GetActiveWindow(), 1, "Papa Doc"
  431.   ' demo depends on button
  432.   Select Case index
  433.     ' line by line ---------------------------------------
  434.     Case 0
  435.       vsprinter1.Footer = "||Line by line"
  436.       vsprinter1.Columns = 2
  437.       For i = 0 To Printer.FontCount - 1
  438.         s = Printer.Fonts(i)
  439.         vsprinter1.FontName = s
  440.         If vsprinter1.FontName = s Then
  441.           vsprinter1.Text = "This is " & s & Chr(13)
  442.         Else
  443.           vsprinter1.Text = "Can't set " & s & Chr(13)
  444.         End If
  445.       Next
  446.       vsprinter1.Columns = 1
  447.     ' paragraph ---------------------------------------
  448.     Case 1
  449.       vsprinter1.PageBorder = 7
  450.       vsprinter1.Footer = "||Paragraph"
  451.       vsprinter1.FontSize = 10
  452.       vsprinter1.FontName = "Script"
  453.       s = "Wrapping and font test. This should work now that I'm using my own font routines... Current font is " & vsprinter1.FontName & Str(vsprinter1.FontSize) & ". "
  454.       s = s & s & s & s & s & s & s & s
  455.       vsprinter1 = s
  456.       vsprinter1.FontName = "MS Sans Serif"
  457.       s = "Wrapping and font test. This should work now that I'm using my own font routines... Current font is " & vsprinter1.FontName & Str(vsprinter1.FontSize) & ". "
  458.       s = s & s & s & s & s & s & s & s
  459.       vsprinter1 = s
  460. Case 666
  461.       ' draw and print all pens
  462.       vsprinter1.PenWidth = 1
  463.       For i = 0 To 6
  464.         vsprinter1 = "Pen #" & Str(i)
  465.         vsprinter1.PenStyle = i
  466.         vsprinter1.X1 = vsprinter1.CurrentX
  467.         vsprinter1.Y1 = vsprinter1.CurrentY
  468.         vsprinter1.X2 = vsprinter1.X1 + 3000
  469.         vsprinter1.Y2 = vsprinter1.Y1
  470.         vsprinter1.Draw = 1
  471.       Next
  472.       
  473.       ' draw some text in boxes
  474.       If True Then
  475.       vsprinter1.FontName = "Arial"
  476.       vsprinter1.FontSize = 18
  477.       vsprinter1.FontBold = True
  478.       vsprinter1.BrushStyle = 0
  479.       vsprinter1.BrushColor = RGB(60, 60, 60)
  480.       vsprinter1.TextColor = RGB(255, 255, 255)
  481.       BoxedText vsprinter1, 2440, 4440, "I can do text in boxes"
  482.       BoxedText vsprinter1, 3440, 3440, "It's easy"
  483.       BoxedText vsprinter1, 3440, 5440, "But no wrapping here..."
  484.       vsprinter1.TextAlign = 1
  485.       BoxedPara vsprinter1, 2000, 6440, 3440, "This one, on the other hand, has wrapping and everything"
  486.       vsprinter1.TextAlign = 2
  487.       BoxedPara vsprinter1, 3000, 7440, 3440, "This one, on the other hand, has wrapping and everything"
  488.       vsprinter1.TextAlign = 0
  489.       BoxedPara vsprinter1, 4000, 8440, 3440, "This one, on the other hand, has wrapping and everything"
  490.       vsprinter1.TextColor = 0
  491.       End If
  492.     ' tables ---------------------------------------
  493.     Case 2
  494.       vsprinter1.PageBorder = 0
  495.       vsprinter1.Footer = "||Tables"
  496.       nl = Chr(13) + Chr(10)
  497.       s = "This is some text that I will put in here... "
  498.       s = s & s & s & s & s & s
  499.       vsprinter1 = s
  500.       vsprinter1 = s
  501.       vsprinter1 = ""
  502.       s = "1500|1640|>1440|^1880;"
  503.       's = s + "Country|Capital|Population|Comments" + nl + "Are always" + nl + "WELCOME;"
  504.       s = s + "Long Title will probably wrap in cell" & nl & "Now this was a hard break|Capital" & nl & "hard-broken|Population|Comments" + nl + "Are always Welcome;"
  505.       vsprinter1.FontBold = True
  506.       vsprinter1.Table = s
  507.       vsprinter1.FontBold = False
  508.       s = "1500|1640|>1440|^1880;"
  509.       s = s + "Argentina|Buenos Aires|50|Tango land;"
  510.       s = s + "Brazil|Brasilia|150|Lambada, anyone?;"
  511.       s = s + "Chile|Santiago|25|This has nothing to do with beans!;"
  512.       vsprinter1.Table = s
  513.       vsprinter1 = ""
  514.       vsprinter1.TableBorder = 7
  515.       vsprinter1.Table = "^1440|^1440|^1440;Line|Quan|Part;"
  516.       vsprinter1.Table = ">1440|>1440|<1440;1|2|ABC123;"
  517.       vsprinter1.Text = "After table...1"
  518.       vsprinter1.Text = "After table...2"
  519.       vsprinter1.Text = "After table...3"
  520.     ' columns ---------------------------------------
  521.     Case 3
  522.       vsprinter1.Footer = "||Columns"
  523.       s = "VSPrinter can also print in multiple columns. "
  524.       s = s + "You have control over column breaks, and you can save "
  525.       s = s + "a whole lot of paper by using multiple columns."
  526.       vsprinter1.Columns = 2
  527.       vsprinter1.TextColor = RGB(90, 90, 90)
  528.       For i = 0 To 36
  529.         vsprinter1 = s
  530.         vsprinter1 = ""
  531.       Next
  532.       vsprinter1.TextColor = 0
  533.       For i = 0 To 36
  534.         vsprinter1 = s
  535.         vsprinter1 = ""
  536.       Next
  537.     ' graphics ---------------------------------------
  538.     Case 4
  539.       vsprinter1.Footer = "||Graphics"
  540.       rc.left = 2000
  541.       rc.top = 2000
  542.       rc.right = 3000
  543.       rc.bottom = 4000
  544.       Debug.Print DrawText(vsprinter1.hdc, "Hellow, world", 13, rc, 0)
  545.       Debug.Print TextOut(vsprinter1.hdc, 1000, 1000, "Lello borlds", 12)
  546.       Debug.Print MoveTo(vsprinter1.hdc, 0, 0)
  547.       Debug.Print LineTo(vsprinter1.hdc, 2000, 2000)
  548.       
  549.       ' simple graphics
  550.       If False Then
  551.       vsprinter1.X2 = vsprinter1.PageWidth
  552.       vsprinter1.Y2 = vsprinter1.PageHeight
  553.       vsprinter1.X1 = 0
  554.       vsprinter1.Y1 = 0
  555.       vsprinter1.BrushColor = &HFF&         'Red
  556.       vsprinter1.BrushStyle = 6             'Cross
  557.       vsprinter1.Draw = 3                   'Circle
  558.       End If
  559.       ' Text
  560.       vsprinter1.CurrentX = vsprinter1.PageWidth / 2
  561.       vsprinter1.CurrentY = vsprinter1.PageHeight / 2
  562.       vsprinter1.TextAlign = 1 ' Center
  563.       vsprinter1.TextColor = &H800000       'Blue
  564.       vsprinter1 = "Add graphics to your reports!"
  565.       vsprinter1.TextColor = &H0&           'Black
  566.       vsprinter1 = "With VSPrinter, it's easy!"
  567.       vsprinter1.TextAlign = 0 ' Left
  568.       
  569.       ' complex graphics
  570.       s = ""
  571.       For X = vsprinter1.MarginLeft To vsprinter1.PageWidth - vsprinter1.MarginRight Step 20
  572.         Y = 6000 + Cos(X * 3.1416 / 180) * (X - vsprinter1.PageWidth / 2) / 10
  573.         s = s + Str(X) + Str(Y)
  574.       Next
  575.       vsprinter1.PenWidth = 10
  576.       vsprinter1.PolyLine = s
  577.       vsprinter1.PenWidth = 0
  578.       
  579.       ' pictures
  580.       vsprinter1.X1 = 1440
  581.       vsprinter1.Y1 = 1440
  582.       vsprinter1.X2 = 3000
  583.       vsprinter1.Y2 = 3000
  584.       vsprinter1.Picture = Image2(0)
  585.       vsprinter1.X1 = vsprinter1.X1 + 1440
  586.       vsprinter1.Y1 = vsprinter1.Y1 + 1440
  587.       vsprinter1.X2 = vsprinter1.X2 + 1440
  588.       vsprinter1.Y2 = vsprinter1.Y2 + 1440
  589.       vsprinter1.Picture = Image2(1)
  590.       vsprinter1.X1 = vsprinter1.X1 + 1440
  591.       vsprinter1.Y1 = vsprinter1.Y1 + 1440
  592.       vsprinter1.X2 = vsprinter1.X2 + 1440
  593.       vsprinter1.Y2 = vsprinter1.Y2 + 1440
  594.       For i = 1 To 6
  595.         vsprinter1.X2 = vsprinter1.X2 - 240
  596.         vsprinter1.Y2 = vsprinter1.Y2 - 240
  597.         vsprinter1.Picture = Image2(2)
  598.       Next
  599.       ' picture from draw control
  600.       vsprinter1.X1 = vsprinter1.X1 + 1440
  601.       vsprinter1.Y1 = vsprinter1.Y1 + 1440
  602.       vsprinter1.X2 = vsprinter1.X1 + 3440
  603.       vsprinter1.Y2 = vsprinter1.Y1 + 3440
  604.       vsprinter1.Picture = fMenu!vsDraw1.Picture
  605.       'fMenu!vsDraw1.Action = 5
  606.       'vsPrinter1.Picture = Clipboard.GetData(3)
  607.     ' rotated text ---------------------------------------
  608.     Case 5
  609.       vsprinter1.Footer = "||Bull"
  610.       vsprinter1.FontSize = 24
  611.       vsprinter1.TextColor = RGB(70, 70, 70)
  612.       For i = 0 To 3600 Step 900
  613.         vsprinter1.CurrentX = 2000
  614.         vsprinter1.CurrentY = 5500
  615.         vsprinter1.TextAngle = i
  616.         vsprinter1.Text = "VSView"
  617.       Next
  618.       vsprinter1.CurrentX = 2000
  619.       vsprinter1.CurrentY = 5500
  620.       s = "VSView by VideoSoft"
  621.       vsprinter1 = s
  622.       vsprinter1.CurrentX = 2010
  623.       vsprinter1.CurrentY = 5510
  624.       vsprinter1.TextColor = 0
  625.       vsprinter1 = s
  626.       ' show address too
  627.       nl = Chr(13)
  628.       s = "2625 Alcatraz Ave." + nl + "Suite 271" + nl + "Berkeley, CA 94705"
  629.       vsprinter1.CurrentX = 2010
  630.       vsprinter1.CurrentY = 5810
  631.       vsprinter1.FontSize = 11
  632.       vsprinter1 = s
  633.      
  634.       ' draw a polygon on draw control
  635.       vsprinter1.PenColor = RGB(70, 70, 70)
  636.       s = ""
  637.       For X = vsprinter1.MarginLeft To vsprinter1.PageWidth - vsprinter1.MarginRight Step 100
  638.         Y = 6000 + Cos(X) * (X - vsprinter1.PageWidth / 2) / 3
  639.         s = s + Str(X) + Str(Y)
  640.       Next
  641.       vsprinter1.PolyLine = s
  642.       vsprinter1.PenColor = 0
  643.   End Select
  644.   '-------------------------------------------------------
  645.   ' all done
  646.   vsprinter1.Action = 6 'End Document
  647.   mousePointer = 0
  648. End Sub
  649. Sub Command2_Click ()
  650.   Dim i%, j%, t&
  651.   t = Timer
  652.   For j = 0 To 5
  653.     For i = 1 To 4
  654.       Command1_Click (i)
  655.     Next
  656.   Next
  657.   Debug.Print "Elapsed: "; Timer - t
  658. End Sub
  659. Sub Form_Load ()
  660.   Dim i%
  661.   vsprinter1.Preview = True
  662.   vsprinter1.PreviewPage = 1
  663.   vsprinter1.Orientation = 0
  664.   vsprinter1.FileName = "This is really the job name"
  665.   cmbZoom.AddItem "35"
  666.   cmbZoom.AddItem "50"
  667.   cmbZoom.AddItem "75"
  668.   cmbZoom.AddItem "100"
  669.   cmbZoom.AddItem "150"
  670.   cmbZoom.AddItem "200"
  671.   cmbZoom.ListIndex = 0
  672.   cmbDev.Clear
  673.   For i = 0 To vsprinter1.NDevices - 1
  674.     cmbDev.AddItem vsprinter1.Devices(i)
  675.   Next
  676.   For i = 0 To vsprinter1.NDevices - 1
  677.     If cmbDev.List(i) = vsprinter1.Device Then
  678.       cmbDev.ListIndex = i
  679.       Exit For
  680.     End If
  681.   Next
  682. End Sub
  683. Sub vsInForm1_ClickLButton (Button As Integer)
  684.   Unload Me
  685. End Sub
  686. Sub VSPrinter1_DblClick ()
  687.   vsprinter1.Action = 10
  688.   vsprinter1.Action = 9
  689. End Sub
  690. Sub VSPrinter1_NewTableCell (Row As Integer, Column As Integer, Cell As String)
  691.   Exit Sub
  692.   If Column = 2 Then
  693.     vsprinter1.FontBold = True
  694.     vsprinter1.FontItalic = True
  695.     vsprinter1.TextColor = RGB(255, 0, 0)
  696.   Else
  697.     vsprinter1.FontBold = False
  698.     vsprinter1.FontItalic = False
  699.     vsprinter1.TextColor = 0
  700.   End If
  701. End Sub
  702.